﻿using System;
using System.Collections.Generic;

using System.Text;
using Microsoft.VisualBasic;
using System.Windows.Forms;
using System.Data;
using Microsoft.Office.Interop.Excel;
using Microsoft.VisualBasic.CompilerServices;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Drawing;
namespace QUANLYCHAMCONG.BL.BUS.Import
{
    public class Sysmboy
    {
        public string SymAbsent = "V";
        public string SymEarly = "Soon";
        public string SymLate = "Late";
        public string SymOnlyIn = "IN";
        public string SymOnlyOut = "OUT";
        public string SymOT = "+";
        public string SymReg = "X";
    }
    public class Until
    {
        public static void  Delay(int SoGiay)
        {
            DateTime time = DateAndTime.DateAdd(DateInterval.Second, (double)SoGiay, DateAndTime.Now);
            while (DateTime.Compare(time, DateAndTime.Now) >= 0)
            {
                System.Windows.Forms.Application.DoEvents();
            }
        }
        public static string LayThu(int so)
        {
            switch (so)
            {
                case 1:
                    return "Chủ Nhật";

                case 2:
                    return "Thứ Hai";

                case 3:
                    return "Thứ Ba";

                case 4:
                    return "Thứ Tư";

                case 5:
                    return "Thứ Năm";

                case 6:
                    return "Thứ Sáu";

                case 7:
                    return "Thứ Bảy";
            }
            return "*";
        }
        public static System.Data.DataTable TaoBangIO()
        {
            System.Data.DataTable table = new System.Data.DataTable();
            DataColumn column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "UserFullCode";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.DateTime");
            column.AllowDBNull = true;
            column.ColumnName = "TimeStr";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "TimeType";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "NewTimeType";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "TimeSource";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "MachineNo";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.DateTime");
            column.AllowDBNull = true;
            column.ColumnName = "TimeDate";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "TimeShort";
            table.Columns.Add(column);
            return table;
        }
        public static System.Data.DataTable TaoBangCong()
        {
            System.Data.DataTable table = new System.Data.DataTable();
            DataColumn column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "UserFullCode";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "UserFullName";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.DateTime");
            column.AllowDBNull = true;
            column.ColumnName = "MDate";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "Thu";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "In1";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "Out1";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "In2";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "Out2";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "In3";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "Out3";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "MShift";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MReg";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MWD";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MOT1";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MOT2";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MOT3";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "MSym";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "MLate";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "MEarly";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MNtime";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MGTotal";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "MaxWorkingTime";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "PunchGrace";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Boolean");
            column.AllowDBNull = true;
            column.ColumnName = "Thaisan";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "TypeNo";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "BL";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "F";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "IDD";
            table.Columns.Add(column);
            return table;
        }
        public static System.Data.DataTable TaobangInOutSch()
        {
            System.Data.DataTable table = new System.Data.DataTable();
            DataColumn column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "ID";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "1";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "2";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "3";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "4";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "5";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "6";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "7";
            table.Columns.Add(column);
            return table;
        }
        public static System.Data.DataTable TaoBangIORun()
        {
            System.Data.DataTable table = new System.Data.DataTable();
            DataColumn column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "UserFullCode";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.DateTime");
            column.AllowDBNull = true;
            column.ColumnName = "TimeDate";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.DateTime");
            column.AllowDBNull = true;
            column.ColumnName = "TimeIn";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.DateTime");
            column.AllowDBNull = true;
            column.ColumnName = "TimeOut";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "Overday";
            table.Columns.Add(column);
            return table;
        }
        public static System.Data.DataTable TaobangShiftSch()
        {
            System.Data.DataTable table = new System.Data.DataTable();
            DataColumn column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "ID";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "1";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "2";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "3";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "4";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "5";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "6";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "7";
            table.Columns.Add(column);
            return table;
        }
        public static System.Data.DataTable TaoBangTong()
        {
            System.Data.DataTable table = new System.Data.DataTable();
            DataColumn column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "UserFullCode";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.String");
            column.AllowDBNull = true;
            column.ColumnName = "UserFullName";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SReg";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "STotal";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SLate";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SEarly";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SOT1";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SOT2";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SOT3";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SGTotal";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "SMNTime";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Int32");
            column.AllowDBNull = true;
            column.ColumnName = "IDD";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "F";
            table.Columns.Add(column);
            column = new DataColumn();
            column.DataType = System.Type.GetType("System.Single");
            column.AllowDBNull = true;
            column.ColumnName = "BL";
            table.Columns.Add(column);
            return table;
        }
        public static string ThuVT(int so)
        {
            switch (so)
            {
                case 1:
                    return "CN";

                case 2:
                    return "T.2";

                case 3:
                    return "T.3";

                case 4:
                    return "T.4";

                case 5:
                    return "T.5";

                case 6:
                    return "T.6";

                case 7:
                    return "T.7";
            }
            return "*";
        }
        public static string XuatThu(int so)
        {
            switch (so)
            {
                case 1:
                    return "CN";

                case 2:
                    return "Hai";

                case 3:
                    return "Ba";

                case 4:
                    return "Tư";

                case 5:
                    return "Năm";

                case 6:
                    return "Sáu";

                case 7:
                    return "Bảy";
            }
            return "*";
        }
    }
}
